import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      component: () => import('@/views/login/index.vue')
    },
    {
      path: '/choice',
      component: () => import('@/views/choice/index.vue')
    },
    {
      path: '/manage/home',
      component: () => import('@/views/manageHome/index.vue')
    },
    {
      path: '/operation/home',
      component: () => import('@/views/operationHome/index.vue')
    },
    {
      path: '/operation/area/:areaId',
      component: () => import('@/views/operationArea/index.vue'),
      props: true
    },
    {
      path: '/operation/factory/:factoryId',
      component: () => import('@/views/operationFactory/index.vue'),
      props: true
    },
    {
      path: '/work/home/:factoryId',
      component: () => import('@/views/workHome/index.vue'),
      props: true
    },
    {
      path: '/work/edit/:factoryId',
      component: () => import('@/views/workEdit/index.vue'),
      props: true
    }
  ]
})

export default router